namespace Ds.DataBase.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class MyKaoHeBiaoTwoUpdate : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.KaoHeDeFenFenXiangs",
                c => new
                    {
                        dffxid = c.Int(nullable: false, identity: true),
                        oneid = c.Int(nullable: false),
                        mbnrid = c.Int(nullable: false),
                        mbnr = c.String(),
                        fz = c.Decimal(nullable: false, precision: 18, scale: 2),
                        mbtype = c.Int(nullable: false),
                        KaoHeDeFenHuiZongInfo_dfid = c.Int(),
                    })
                .PrimaryKey(t => t.dffxid)
                .ForeignKey("dbo.KaoHeDeFenHuiZongs", t => t.KaoHeDeFenHuiZongInfo_dfid)
                .Index(t => t.KaoHeDeFenHuiZongInfo_dfid);
            
            CreateTable(
                "dbo.MyKaoHeBiao_twoFuJians",
                c => new
                    {
                        fjid = c.Int(nullable: false, identity: true),
                        path = c.String(),
                        fjmc = c.String(),
                        bz = c.String(),
                        MyKaoHeBiaoTwo_twoid = c.Int(),
                    })
                .PrimaryKey(t => t.fjid)
                .ForeignKey("dbo.MyKaoHeBiao_two", t => t.MyKaoHeBiaoTwo_twoid)
                .Index(t => t.MyKaoHeBiaoTwo_twoid);
            
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.MyKaoHeBiao_twoFuJians", "MyKaoHeBiaoTwo_twoid", "dbo.MyKaoHeBiao_two");
            DropForeignKey("dbo.KaoHeDeFenFenXiangs", "KaoHeDeFenHuiZongInfo_dfid", "dbo.KaoHeDeFenHuiZongs");
            DropIndex("dbo.MyKaoHeBiao_twoFuJians", new[] { "MyKaoHeBiaoTwo_twoid" });
            DropIndex("dbo.KaoHeDeFenFenXiangs", new[] { "KaoHeDeFenHuiZongInfo_dfid" });
            DropTable("dbo.MyKaoHeBiao_twoFuJians");
            DropTable("dbo.KaoHeDeFenFenXiangs");
        }
    }
}
